<?php 
    $entity = pc_variable("value");
    if($entity !== null) {
        $type = $entity->getType(); 
        $typeConfig = pc_config("cm.type." . $type->getFullName());
        $name = $typeConfig->getPrimaryPropertyName();
        $attribute = $type->getAttribute($name);
?>
<a href="<?php pc_echo(pc_link("Find", array("typeName" => $type->getFullName(), "id" => $entity->getId()))); ?>">
    <?php pc_pagelet("list-entities/attribute/switch", 
        array(
            "attribute" => $attribute,
            "name" => $name,
            "value" => $entity->get($name)
        )); ?>
</a>
<?php } ?>